﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>开关灯3</title>
    <style>
        a{
            color: #c01900;
            text-decoration: none;
        }
    </style>
</head>
<body>
<a href="判断两个数的大小.html">判断两个数的大小</a>
<br/>
<br/>
<img src="pic_bulboff.gif" height="180" width="100" id="pic"/>
<input type="button" value="开灯" onclick="kaiGuanDeng()" id="anniu">
<script>
    function kaiGuanDeng() {
        if(anniu.value=="开灯"){
            pic.src="pic_bulbon.gif";
            anniu.value="关灯";
        }else{
            pic.src="pic_bulboff.gif";
            anniu.value="开灯";
        }
    }
</script>
</body>
</html>